<!-- Copyright (c) 2019 Legytma Soluções Inteligentes (https://legytma.com.br). -->
<!-- -->
<!--  Licensed under the Apache License, Version 2.0 (the "License"); -->
<!--  you may not use this file except in compliance with the License. -->
<!--  You may obtain a copy of the License at -->
<!-- -->
<!--       http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
    <meta name="description"
          content="API docs for the asBroadcastStream method from the JsonSchemaBloc class, for the Dart programming language.">
    <title>asBroadcastStream method - JsonSchemaBloc class - schema_form library - Dart API</title>
    <!-- required because all the links are pseudo-absolute -->
    <base href="../..">

    <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700"
          rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="static-assets/github.css">
    <link rel="stylesheet" href="static-assets/styles.css">
    <link rel="icon" href="static-assets/favicon.png">

</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
    <button id="sidenav-left-toggle" type="button">&nbsp;</button>
    <ol class="breadcrumbs gt-separated dark hidden-xs">
        <li><a href="index.html">schema_form</a></li>
        <li><a href="schema_form/schema_form-library.html">schema_form</a></li>
        <li><a href="schema_form/JsonSchemaBloc-class.html">JsonSchemaBloc</a></li>
        <li class="self-crumb">asBroadcastStream method</li>
    </ol>
    <div class="self-name">asBroadcastStream</div>
    <form class="search navbar-right" role="search">
        <input type="text" id="search-box" autocomplete="off" disabled
               class="form-control typeahead" placeholder="Loading search...">
    </form>
</header>

<main>

    <div id="dartdoc-sidebar-left"
         class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
        <header id="header-search-sidebar" class="hidden-l">
            <form class="search-sidebar" role="search">
                <input type="text" id="search-sidebar" autocomplete="off" disabled
                       class="form-control typeahead" placeholder="Loading search...">
            </form>
        </header>

        <ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
            <li><a href="index.html">schema_form</a></li>
            <li><a href="schema_form/schema_form-library.html">schema_form</a></li>
            <li><a href="schema_form/JsonSchemaBloc-class.html">JsonSchemaBloc</a></li>
            <li class="self-crumb">asBroadcastStream method</li>
        </ol>

        <h5>JsonSchemaBloc class</h5>
        <ol>
            <li class="section-title"><a href="schema_form/JsonSchemaBloc-class.html#constructors">Constructors</a>
            </li>
            <li><a href="schema_form/JsonSchemaBloc/JsonSchemaBloc.html">JsonSchemaBloc</a></li>

            <li class="section-title">
                <a href="schema_form/JsonSchemaBloc-class.html#instance-properties">Properties</a>
            </li>
            <li><a href="schema_form/JsonSchemaBloc/formContext.html">formContext</a></li>
            <li><a href="schema_form/JsonSchemaBloc/formKey.html">formKey</a></li>
            <li><a href="schema_form/JsonSchemaBloc/initialState.html">initialState</a></li>
            <li><a href="schema_form/JsonSchemaBloc/onFormChanged.html">onFormChanged</a></li>
            <li><a href="schema_form/JsonSchemaBloc/onFormWillPop.html">onFormWillPop</a></li>
            <li><a href="schema_form/JsonSchemaBloc/submitData.html">submitData</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/first.html">first</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/hashCode.html">hashCode</a>
            </li>
            <li class="inherited"><a
                    href="schema_form/JsonSchemaBloc/isBroadcast.html">isBroadcast</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/isEmpty.html">isEmpty</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/last.html">last</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/length.html">length</a></li>
            <li class="inherited"><a
                    href="schema_form/JsonSchemaBloc/runtimeType.html">runtimeType</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/single.html">single</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/state.html">state</a></li>

            <li class="section-title"><a
                    href="schema_form/JsonSchemaBloc-class.html#instance-methods">Methods</a></li>
            <li><a href="schema_form/JsonSchemaBloc/close.html">close</a></li>
            <li><a href="schema_form/JsonSchemaBloc/getFieldStream.html">getFieldStream</a></li>
            <li><a href="schema_form/JsonSchemaBloc/getFormData.html">getFormData</a></li>
            <li><a href="schema_form/JsonSchemaBloc/getPropertySchema.html">getPropertySchema</a>
            </li>
            <li><a href="schema_form/JsonSchemaBloc/mapEventToState.html">mapEventToState</a></li>
            <li><a href="schema_form/JsonSchemaBloc/onClicked.html">onClicked</a></li>
            <li><a href="schema_form/JsonSchemaBloc/validate.html">validate</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/add.html">add</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/any.html">any</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/asBroadcastStream.html">asBroadcastStream</a>
            </li>
            <li class="inherited"><a
                    href="schema_form/JsonSchemaBloc/asyncExpand.html">asyncExpand</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/asyncMap.html">asyncMap</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/cast.html">cast</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/contains.html">contains</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/distinct.html">distinct</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/drain.html">drain</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/elementAt.html">elementAt</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/every.html">every</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/expand.html">expand</a></li>
            <li class="inherited"><a
                    href="schema_form/JsonSchemaBloc/firstWhere.html">firstWhere</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/fold.html">fold</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/forEach.html">forEach</a></li>
            <li class="inherited"><a
                    href="schema_form/JsonSchemaBloc/handleError.html">handleError</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/join.html">join</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/lastWhere.html">lastWhere</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/listen.html">listen</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/map.html">map</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/noSuchMethod.html">noSuchMethod</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/onError.html">onError</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/onEvent.html">onEvent</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/onTransition.html">onTransition</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/pipe.html">pipe</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/reduce.html">reduce</a></li>
            <li class="inherited"><a
                    href="schema_form/JsonSchemaBloc/singleWhere.html">singleWhere</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/skip.html">skip</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/skipWhile.html">skipWhile</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/take.html">take</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/takeWhile.html">takeWhile</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/timeout.html">timeout</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/toList.html">toList</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/toSet.html">toSet</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/toString.html">toString</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/transform.html">transform</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/transformEvents.html">transformEvents</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/transformStates.html">transformStates</a>
            </li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/where.html">where</a></li>

            <li class="section-title inherited"><a
                    href="schema_form/JsonSchemaBloc-class.html#operators">Operators</a></li>
            <li class="inherited"><a href="schema_form/JsonSchemaBloc/operator_equals.html">operator
                ==</a></li>


        </ol>
    </div><!--/.sidebar-offcanvas-->

    <div id="dartdoc-main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
        <div><h1><span class="kind-method">asBroadcastStream</span> method</h1></div>

        <section class="multi-line-signature">
            <span class="returntype">Stream<span class="signature">&lt;<wbr><span
                    class="type-parameter"><a href="schema_form/JsonSchemaState-class.html">JsonSchemaState</a></span>&gt;</span></span>
            <span class="name ">asBroadcastStream</span>
            (
            <wbr>
            {<span class="parameter" id="asBroadcastStream-param-onListen"><span
                class="type-annotation">void</span> <span
                class="parameter-name">onListen</span>(<span class="parameter"
                                                             id="onListen-param-subscription"><span
                class="type-annotation">StreamSubscription<span class="signature">&lt;<wbr><span
                class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">subscription</span></span>), </span>
            <span class="parameter" id="asBroadcastStream-param-onCancel"><span
                    class="type-annotation">void</span> <span class="parameter-name">onCancel</span>(<span
                    class="parameter" id="onCancel-param-subscription"><span
                    class="type-annotation">StreamSubscription<span class="signature">&lt;<wbr><span
                    class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">subscription</span></span>)</span>
            })
            <div class="features">inherited</div>
        </section>
        <section class="desc markdown">
            <p>Returns a multi-subscription stream that produces the same events as this.</p>
            <p>The returned stream will subscribe to this stream when its first
                subscriber is added, and will stay subscribed until this stream ends,
                or a callback cancels the subscription.</p>
            <p>If <code>onListen</code> is provided, it is called with a subscription-like object
                that represents the underlying subscription to this stream. It is
                possible to pause, resume or cancel the subscription during the call
                to <code>onListen</code>. It is not possible to change the event handlers, including
                using <code>StreamSubscription.asFuture</code>.</p>
            <p>If <code>onCancel</code> is provided, it is called in a similar way to
                <code>onListen</code>
                when the returned stream stops having listener. If it later gets
                a new listener, the <code>onListen</code> function is called again.</p>
            <p>Use the callbacks, for example, for pausing the underlying subscription
                while having no subscribers to prevent losing events, or canceling the
                subscription when there are no listeners.</p>
        </section>

        <section class="summary source-code" id="source">
            <h2><span>Implementation</span></h2>
            <pre class="language-dart"><code class="language-dart">Stream&lt;T&gt; asBroadcastStream(
    {void onListen(StreamSubscription&lt;T&gt; subscription),
    void onCancel(StreamSubscription&lt;T&gt; subscription)}) {
  return new _AsBroadcastStream&lt;T&gt;(this, onListen, onCancel);
}</code></pre>
        </section>

    </div> <!-- /.main-content -->

    <div id="dartdoc-sidebar-right"
         class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
    </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    schema_form 1.0.0
  </span>


</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
